<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
	<form name="enterInterface" id="enterInterface" method="post"
		action="login">
		<div class="enter">
			<div class="enterBox">
				<p>
					<label for="userName">用户名:<input id="userName"
						name="account" /></label>
				</p>
				<p>
					<label for="passWord">密码:<input id="passWord"
						name="password" /></label>
				</p>
				<p>
					<label for="securityCode">验证码:<input id="securityCode"
						name="securityCode" /><img id="securityPicture"
						src="check_code.do" /><a id="securityText">看不清换一张</a></label>
				</p>
			</div>
		</div>
		<div class="bottonBox">
			<button class="buttonEnter">登录</button>
			<button class="buttonRegister">注册</button>
		</div>
	</form>
	<script>
		var button1 = document.getElementsByClassName("buttonEnter");
		button1.onclick = handleButtonPress;
		var httpRequest;

		function handleButtonPress(e) {
			e.preventDefault();
			var form = document.getElementById("enterInterface");
			var formDate = "";
			var inputElements = document.getElementsByTagName("input");
			for (var i = 0; i < inputElements.length; i++) {
				formData += inputElements[i].name + "="
						+ inputElements[i].value + "&";
			}
			httpRequest = new XMLHttpRequest();
			httpRequest.onreadystatechange = handleResponse;
			httpRequest.open("POST", form.action);
			httpRequest.setRequestHeader('Content-type',
					'application/x-www-form-urlencoded');
			httpRequest.send(formData);
		}
	</script>
</body>
</html>
